//---------------------------------------------------------------------------

#include "vcl_stl.h"
#pragma hdrstop

#include "h_scrollingwincontrol.h"

//---------------------------------------------------------------------------

__fastcall HScrollingWinControl::HScrollingWinControl(
   Classes::TComponent* AOwner) : TScrollingWinControl(AOwner)
{
   AutoScroll = true;
}

__fastcall HScrollingWinControl::~HScrollingWinControl(void)
{
}

void __fastcall HScrollingWinControl::WndProc(TMessage &Message)
{
   if ( Message.Msg == WM_MOUSEWHEEL )
   {
      int i = (signed short)(Message.WParam >> 16);
      int OldPos = VertScrollBar->Position;
      VertScrollBar->Position -= i;
      if ( VertScrollBar->Position != OldPos )
      {
         Invalidate();
      }
   }

   if ( Message.Msg == WM_HSCROLL ||
        Message.Msg == WM_VSCROLL )
   {
      Invalidate();
   }

   inherited::WndProc(Message);
}

#pragma package(smart_init)
